<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class Menus extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('menus', function (Blueprint $table) {
             $table->engine = 'InnoDB';
             $table->charset = 'utf8';
             $table->collation = 'utf8_unicode_ci';
            // CONTENT
            $table->increments('id')->nullable(false)->comment('');
			$table->integer('pid')->nullable()->default(0)->comment('');
			$table->string('route_path', 100)->nullable(false)->comment('');
			$table->string('route_name', 100)->nullable(false)->comment('');
			$table->string('pri', 50)->nullable()->default(null)->comment('菜单权限');
			$table->string('component', 100)->nullable(false)->comment('');
			$table->string('redirect', 100)->nullable()->default(null)->comment('');
			$table->text('meta')->nullable()->comment('');
			$table->timestamp('created_at')->nullable()->comment('');
			$table->timestamp('updated_at')->nullable()->comment('');
			$table->string('path', 255)->nullable(false)->default(0)->comment('');
			$table->string('name', 100)->nullable(false)->comment('');
			$table->boolean('hidden')->nullable(false)->default(0)->comment('');
			$table->string('buttons', 255)->nullable()->default(null)->comment('');
			$table->boolean('always_show')->nullable(false)->default(0)->comment('');
			$table->string('menu_group', 50)->nullable()->default(null)->comment('');
			$table->unsignedInteger('_lft')->nullable(false)->comment('');
			$table->unsignedInteger('_rgt')->nullable(false)->comment('');
			$table->string('icon', 50)->nullable()->default(null)->comment('');
			$table->boolean('leaf')->nullable()->default(0)->comment('');
			$table->unsignedInteger('sort_order')->nullable()->default(0)->comment('');
			$table->string('link_dpt_id', 50)->nullable()->default(null)->comment('关联分类编号');
			$table->boolean('link_field')->nullable()->default(1)->comment('关联字段(1=设备, 2=区域)');
			$table->boolean('props')->nullable()->default(0)->comment('路由属性');
			$table->boolean('menu_type')->nullable()->default(1)->comment('菜单类型(1=菜单, 2=目录)');
			
        });

        
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('menus');
    }
}
